package com.leapp.sk.ui.activity.join

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.app.SKApplication
import com.leapp.sk.binder.join.ToExamineBinder
import com.leapp.sk.ui.activity.AppMainTableActivity
import com.example.util.finallist.IS_BABY_ARCHIVES
import com.leapp.sk.viewdelegate.join.ToExamineDelegate

/**
 * 等待审核
 * @author  chaohaipeng  on 2018/7/12.
 */
class ToExamineActivity : BaseActivityMVP<ToExamineDelegate>() {
    /**
     * 是否是宝贝档案
     */
    var isBaby: Boolean?=false
    override fun getDataBinder(): BaseDataBinder<*, *> {
        return ToExamineBinder()
    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_examine_title))
    }

    override fun initDate() {
        isBaby= intent?.getBooleanExtra(IS_BABY_ARCHIVES,false)
    }

    override fun bindEvenListener() {
        viewDelegate.setOnClickListener(View.OnClickListener {
                 if (isBaby!!){
                    SKApplication.getInstance()?.exit(2)
                 }else{
                     val intent: Intent = Intent(this, AppMainTableActivity::class.java)
                     startActivity(intent)
                 }

        }, R.id.tv_ate_complete)
    }

    override fun getDelegateClass(): Class<ToExamineDelegate> {
        return ToExamineDelegate::class.java
    }


}